package mop.model.resource;



import mop.exception.IllegalDescriptionException;
import mop.exception.IllegalDuplicationException;
import mop.exception.IllegalIdException;
import mop.model.AbstractModelWithDescription;
import mop.model.DataBase;


/**
 * ResourceType class
 * @author MOP Team 7
 * 
 * @invar Description is valid.
 *  	  @see AbstractDescriptionModel
 */
public class ResourceType extends AbstractModelWithDescription implements ResourceTypeInterface
{

	/**
	 * Constructor for ResourceType
	 * 
	 * @param db reference to the database
	 * @param description the description of the resourcetype
	 * 
	 * @effect	(Tries to) set the description.
	 * 			| setDescription(description)
	 * 
	 * @effect gets added to the database db
	 * 
	 * @throws  IllegalDescriptionException	Thrown when the Project description is invalid
	 * 	@see AbstractModelWithDescription#AbstractModelWithDescription(String, String)
	 * @throws IllegalDuplicationException 
	 * 		ResourceType already exists
	 * @throws IllegalIdException 
	 */
	public ResourceType(DataBase<ResourceType> db,String id,String description) throws IllegalDescriptionException,IllegalDuplicationException, IllegalIdException
	{
		super(id,description);
		db.add(this);
	}
	
	/***************************************************************************
	 * 						Model interface
	 ***************************************************************************/
	
	/**
	 * get a reference to the interface
	 * @return this
	 */
	public ResourceTypeInterface getInterface()
	{
		return this;
	}

}
